<!-- **聚合图 -->

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../src/css/reset.css" />
		<link rel="stylesheet" type="text/css" href="../../src/css/main.css" />
		<link rel="stylesheet" type="text/css" href="../../libs/leaflet/leaflet.css" />
		<link rel="stylesheet" type="text/css" href="../../libs/cluster/prunecluster.css"/>
		<script src="../../libs/leaflet/leaflet.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../libs/leaflet/leaflet.ChineseTmsProviders.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../libs/cluster/prunecluster.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="map"></div>
		<script type="text/javascript"  id="my_script">
		// 引入文件 src="../../libs/cluster/prunecluster.js" 
			let map = L.map('map', {
				center: [32.444721222054795, 119.4224873962402], // leaflet 所有坐标都是纬度在前,经度在后的
				zoom: 10
			})
			
			// 地图依赖于leaflet.ChineseTmsProviders.js  他提供4326坐标系的天地图,高德地图等
			let baseLayer = L.tileLayer.chinaProvider('TianDiTu.Normal.Map', {
				maxZoom: 18,
				minZoom: 10
			})
			map.addLayer(baseLayer)
			let labelLayer = L.tileLayer.chinaProvider('TianDiTu.Normal.Annotion', {
				maxZoom: 18,
				minZoom: 10
			})
			map.addLayer(labelLayer)
			
			let leafletView = new PruneClusterForLeaflet();
			leafletView.Cluster.Size = 200; //集合范围的大小
			let size = 1000000;
			let markers = []
			for (var i = 0; i < size; ++i) {
				let marker = new PruneCluster.Marker(30 + (Math.random() - 0.5) * 0.0001 * size, 120 + (Math.random() -
					0.5) * 0.0002 * size, {
					popup: "Roger " + i
				});
				markers.push(marker)
				leafletView.RegisterMarker(marker);
			}
			map.addLayer(leafletView);
		</script>
	</body>
</html>
